package cn.kow.kmall.common.util;

import org.apache.commons.lang3.StringUtils;

/**
 * @Author: lijun
 * @Description:
 * @Date: Created in 2020-06-19 9:39
 * @Modified By:
 */
public class ItemUtils {

    /**
     * SKU规格名称格式化
     *
     * @param skuSpecName
     * @return
     */
    public static String formatSkuSpecName(String skuSpecName) {
        if (StringUtils.isBlank(skuSpecName)) {
            return "";
        }
        StringBuilder stringBuilder = new StringBuilder();
        for (String s : skuSpecName.split(";")) {
            stringBuilder.append(s.split(":")[1]).append(",");
        }
        String specName = stringBuilder.substring(0, stringBuilder.length()-1);
        return specName;
    }
}
